<%@ page import="example.entity.Book" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>书籍信息更新</title>
</head>
<body>
<h1>书籍信息更新</h1>
<form action="bookServlet" method="get">
    <%
        Book book = (Book) request.getAttribute("book");
    %>
    <input type="hidden" name="path" value="saveUpdate">
    <input type="hidden" name="id" value="<%=book.getId()%>">
    <table border="1" cellspacing="0" cellpadding="0">
        <tr>
            <td>
                <span>书籍名称:</span>
            </td>
            <td>
                <label>
                    <input type="text" name="name" value="<%=book.getName()%>">
                </label>
            </td>
        </tr>
        <tr>
            <td>
                <span>作者:</span>
            </td>
            <td>
                <label>
                    <input type="text" name="author" value="<%=book.getAuthor()%>">
                </label>
            </td>
        </tr>
        <tr>
            <td>
                <span> 豆瓣评分:</span>
            </td>
            <td>
                <label>
                    <input type="text" name="score" value="<%=book.getScore()%>">
                </label>
            </td>
        </tr>
        <tr>
            <td>
                <span> 出版时间:</span>
            </td>
            <td>
                <label>
                    <input type="month" name="pubDate" value="<%=book.getFormattedPubDate()%>">
                </label>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="submit" value="更新">
                <input type="reset" value="重置">
            </td>
        </tr>
    </table>
</form>
</body>
</html>
<style>
    h1 {
        text-align: center;
    }

    table {
        margin: 0 auto;
        border-collapse: collapse;
        width: 40%;
    }

    td {
        text-align: center;
        padding: 8px;
    }

    input {
        padding: 8px;
        border: 1px solid #ccc;
        border-radius: 4px;
    }

    input[type="submit"], input[type="reset"] {
        background-color: #4CAF50;
        color: white;
        padding: 8px 16px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
    }
</style>